package com.wqtz.chechai.adapter;

import android.view.View;

import com.wqtz.chechai.R;
import com.wqtz.chechai.base.lvbaseadapter.LvBaseAdapter;
import com.wqtz.chechai.base.lvbaseadapter.ViewHolder;
import com.wqtz.chechai.bean.Status;

import java.util.List;

/**
 * 项目名称： CheChai
 * 创建人 : Liberation
 * 创建时间: 2017/2/23 14:08
 */

public class AdSearchStatusAdapter extends LvBaseAdapter<Status> {
	private QuoteResItemClickCallBack mBack;
	private int nowPosition;
	public  void setClickListen(QuoteResItemClickCallBack mBack){
		this.mBack = mBack;
	}
	public AdSearchStatusAdapter(int resId,int nowPosition) {
		super(resId);
		this.nowPosition = nowPosition;
	}

	@Override
	public void bindDatas(List<Status> list, final int position, final ViewHolder holder) {
		holder.setText(R.id.tv,list.get(position).status);
		if(list.get(position).isChecked){
			holder.getView(R.id.iv_check).setVisibility(View.VISIBLE);
		}else {
			holder.getView(R.id.iv_check).setVisibility(View.GONE);
		}

		holder.getView(R.id.ll_status).setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				mBack.quoteResItemClickCallBack(position);
			}
		});


	}
	public interface QuoteResItemClickCallBack {
		void quoteResItemClickCallBack(int positon);
	}

}
